﻿
/*
 * Copyright (C) Han Wei
 */


using System;
using System.Collections.Generic;


namespace BSvr.Model
{
    /// <summary>
    /// 查询结果集合类
    /// </summary>
    [Serializable]
    public class EntyCollection<T> : List<T>
    {
        private uint m_CurPageIndex;
        private uint m_ReqPageSize;
        private uint m_Total;

        /// <summary>
        /// 符合条件的记录总数
        /// </summary>
        public uint Total { get { return this.m_Total; } }

        /// <summary>
        /// 当前页码
        /// </summary>
        public uint CurPageIndex { get { return this.m_CurPageIndex; } }

        /// <summary>
        /// 当前页面记录数
        /// </summary>
        public uint CurPageSize { get { return (uint)this.Count; } }

        /// <summary>
        /// 预期的记录数
        /// </summary>
        public uint ReqPageSize { get { return this.m_ReqPageSize; } }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="curPageIndex">当前页码</param>
        /// <param name="curReqPageSize">预期记录数</param>
        /// <param name="total">符合条件的记录总数</param>
        public EntyCollection(uint curPageIndex, uint reqPageSize, uint total)
        {
            this.m_CurPageIndex = curPageIndex;
            this.m_ReqPageSize = reqPageSize;
            this.m_Total = total;
        }
    }
}
